package pl.elka.simulator.core.configurationCommand.impl.param;

import pl.elka.simulator.core.IPaintable;
import pl.elka.simulator.core.Position;
import pl.elka.simulator.core.configurationCommand.ICommandParam;
import pl.elka.simulator.core.configurationCommand.ICommandParamConstructor;

public class PositionParamConstructor implements ICommandParamConstructor {

	private Position position;
	
	@Override
	public ICommandParamConstructor newInstance() {		
		return new PositionParamConstructor();
	}

	@Override
	public void appendPart(String partName, Object value) {
		if(ICommandParamConstructor.POSITION.equals(partName)){
			position = (Position)value;
		}
	}

	@Override
	public boolean isParamConstruced() {		
		return position!=null;
	}

	@Override
	public ICommandParam getParam() {
		PositionCommandParam p = new PositionCommandParam();
		p.setPosition(position);
		return p;
	}
	public IPaintable getVisibleParts(){
		return null;
	}
}
